﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace CustomersService
{
    public class Customers : ICustomers
    {
        // Finder
        public List<Customer> GetAllCustomers()
        {
            return new List<Customer>()
            {
                new Customer
                {
                    CustomerID = 1,
                    CustomerName = "Bob",
                },
                new Customer
                {
                    CustomerID = 2,
                    CustomerName = "Bill",
                },
                new Customer
                {
                    CustomerID = 3,
                    CustomerName = "Cheryl",
                },
            };
        }

        // Specific finder
        public Customer GetCustomerByID(int CustomerID)
        {
            return GetAllCustomers().FirstOrDefault(c => c.CustomerID == CustomerID);
        }
    }
}